gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\svm\svmhyper.m
function w = svmhyper(Xtrn,Itrn,alpha) % SVMHYPER coputes normal vector of linear SVM decision rule. % w = svmhyper(X,I,Alpha) % % The decision hyperplane is formed by the points x for which % equation w'*x + bias = 0 holds. % % Input: % X [DxM] training patterns. % I [1xM] labels of training patterns. % Alpha [Mx1] Lagrange multipliers. % % Output: % w [Dx1] normal vector. % % See also SVMCLASS, SVM. % % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac % (c) Czech Technical University Prague, http://cmp.felk.cvut.cz % Modifications % 19-September-2001, V. Franc, comments changed. dim=size(Xtrn,1); Ytrn=3-2*Itrn; w = (Xtrn.*repmat(Ytrn,dim,1))*alpha'; return;